/**
 * Created by Administrator on 2017/4/28 0028.
 */

function moveLR(id,target) {
    clearInterval(id.LR);
    var tmp=id.offsetLeft<target?10:-10;
    id.LR=setInterval(function () {
        id.style.left=id.offsetLeft+tmp+"px";
        if(Math.abs(id.offsetLeft-target)<=10){
            id.style.left=target+"px";
            clearInterval(id.LR);
        }
    },10)
}
function moveTB(id,target) {
    clearInterval(id.TB);
    var tmp=id.offsetTop<target?10:-10;
    id.TB=setInterval(function () {
        id.style.top=id.offsetTop+tmp+"px";
        if(Math.abs(id.offsetTop-target)<=10){
            id.style.top=target+"px";
            clearInterval(id.TB);
        }
    },40)
}